// basicnpc.txt
// A very simple, naive text. Creature attacks anything it hates nearby.
// Once it has won, it returns to its home.
// Memory Cells:
//   Cell 0 - How creature moves.
//     0 - If 0, wander randomly. 
//     1 - Stands still until a target appears.
//     2 - Completely immobile, even if target appears.
//   Cell 1,2 - Stuff done flag. If both 0, nothing. Otherwise when this 
//     is killed, set to 1. (Example: If cell 1 is 3 and cell 2 is 5, when
//     creature is killed, sets SDF(3,5) to 1.)
//   Cell 3 - Dialogue node to start with if talked to. if left at 0, this
//     character doesn't talk.

begincreaturescript;

variables;

short i,target,bmessage;

body;

beginstate INIT_STATE;
	if (get_memory_cell(0) == 2)
		set_mobility(ME,0);
	break;

beginstate DEAD_STATE;

	kill_char(my_number(),2,0);
	pause(3);
	reset_dialog();
	add_dialog_str(0,"You and your brother have helped free one another.  You can be cool and kick back now.",0);
	add_dialog_choice(0,"At last!");
	bmessage = run_dialog(0);
	set_flag(1,0,10);

break;

beginstate START_STATE; 
		set_char_status(11,29,8,1,0);
		end_combat_turn();
		end();
break;

beginstate 3; // attacking
		set_char_status(11,29,8,1,0);
		end_combat_turn();
		end();
break;

beginstate TALKING_STATE;
		set_char_status(11,29,8,1,0);
		end_combat_turn();
		end();
break;